package org.xmls.common.base.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 平台类型枚举
 */
@Getter
@AllArgsConstructor
public enum PlatformTypeEnum {

    TIKTOK(1, "TIKTOK"),
    BILIBILI(2, "B站"),
    XIAOHONGSHU(3, "小红书"),
    KUAISHOU(4, "快手"),
    TOUTIAO(5, "今日头条"),
    TENCENT(6, "腾讯"),
    ;

    private final Integer code;
    private final String name;

    public static PlatformTypeEnum getByCode(Integer code) {
        for (PlatformTypeEnum value : values()) {
            if (value.getCode().equals(code)) {
                return value;
            }
        }
        return null;
    }
}
